<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 扩展运算符'...'
        var arr1 = [1,2,3,4];
        var arr2 = [5,6,7];
        var re1 = [...arr1,...arr2];
        console.log(re1);

        var obj1 = {
            name:'t'
        }
        var obj2 = {
            age:12
        }
        var re2 = {...obj1,...obj2}
        console.log(re2);

        // 把多余的参数放进数组'...arg'
        function fun(a,...arg){
            console.log(a,arg);
            // 将类数组对象转换为数组
            console.log(Array.from(arguments));
        }
        fun(1,2,3)
    </script>
</body>
</html>